const fs=require("fs");
const path=require("path");
// 写入文件
fs.writeFileSync(path.join(__dirname,"./03-copy.txt"),"我准备拷贝文件  ","utf8");
// 追加文件
fs.appendFileSync(path.join(__dirname,"./03-copy.txt"),"我继续追加信息到文件中","utf8")

let result=fs.statSync(path.join(__dirname,"./03-copy.txt"))
  //获取文件‘03-copy.txt’大小 单位是字节；
  console.log(result.size);
  //获取文件‘03-copy.txt’的创建时间
  console.log(result.birthtime);
  //判断‘03-copy.txt’是否是一个文件
  console.log(result.isFile());
  //判断‘03-copy.txt’是不是目录
  console.log(result.isDirectory())
fs.copyFileSync(path.join(__dirname,"./03-copy.txt"),path.join(__dirname,"./03-copyFile.txt"),"utf8")